package com.example.xiangmuservice.service.impl;

import com.alibaba.fastjson.JSON;
import com.example.api.service.CccService;
import com.example.xiangmuservice.dao.CccRepository;
import com.example.xiangmuservice.entity.Ccc;
import com.example.xiangmuservice.entity.Www;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Optional;

@Service
public class CccServiceImpl implements CccService {

    @Autowired
    private CccRepository cccRepository;

    @Override
    public String findById(Integer id) {
        Optional<Ccc> optional = cccRepository.findById(id);
        if (optional.isPresent()){
            return JSON.toJSONString(optional.get());
        }
        return null;
    }
}
